package fileby.ctrl.actions.impl;

import fileby.model.IMagicBoxManager;
import java.awt.event.ActionEvent;
import java.awt.event.InputEvent;
import java.awt.event.KeyEvent;
import javax.swing.AbstractAction;
import javax.swing.KeyStroke;

/**
 *
 * @author Ludwig Kjellstrom
 */
class ExportMagicBoxAction extends AbstractAction {

    private IMagicBoxManager magicBoxManager;

    public ExportMagicBoxAction(IMagicBoxManager magicBoxManager) {
        super("Export Magic Box", null);
        this.magicBoxManager = magicBoxManager;
        putValue(SHORT_DESCRIPTION, "Add the contents of the magic box to the current folder");
        putValue(MNEMONIC_KEY, KeyEvent.VK_E);
        putValue(ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_RIGHT,
                InputEvent.CTRL_DOWN_MASK));
    }

    public void actionPerformed(ActionEvent e) {
        magicBoxManager.exportMagicBox();
    }
}
